﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" 
    AutoEventWireup="true" CodeFile="CompanyProfile.aspx.cs" Inherits="Pages_Public_CompanyProfile" EnableViewState="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageHeader" Runat="Server"> 
    <style type="text/css">        
        .SendYourQuery
        {
            width:176px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) -200px 0px no-repeat;
        	cursor:pointer;
        }
        .SendYourQuery:hover
        {
            width:176px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) -200px -44px no-repeat;
        	cursor:pointer;
        }
    </style>  
    <script language="javascript" type="text/javascript">
        var _CustomerID = <%= _CustomerID %>
        var _Message = null;
        function PopulateMessageObject() {
            _Message = new App.CustomEntity.Message();
            _Message.CustomerID = _CustomerID;
            _Message.FirstName = $('#<%=txtFirstName.ClientID %>').val();
            _Message.LastName = $('#<%=txtLastName.ClientID %>').val();
            _Message.FromEmail = $('#<%=txtFromEmail.ClientID %>').val();
            _Message.Address = $('#<%=txtAddress.ClientID %>').val();
            _Message.Phone = $('#<%=txtPhone.ClientID %>').val();
            _Message.Subject = $('#<%=txtSubject.ClientID %>').val();
            _Message.SenderMessage = $('#<%=txtMessage.ClientID %>').val();
        }
        function SendQuery(elementID) {
            $('#divSentQueryMessage').hide();
            if (Page_ClientValidate('SendQuery')) {
                ShowProgressAnimation(elementID, -100, 0);
                PopulateMessageObject();
                PageMethods.SendQueryToCustomer(_Message, SendQuery_Success, OnAjax_Error, OnAjax_TimeOut);
            }
        }
        function SendQuery_Success(result){
            HideProgressAnimation();
            $('#divSentQueryMessage').fadeIn('slow', null);
            $('#tblSendQueryForm input, #tblSendQueryForm textarea').val('');
        }
        $(document).ready(function () {
            $('.ContentBox').hover(function () {
                $(this).find('.ContentHeading').addClass('ContentHeadingHover');
            },
            function () {
                $(this).find('.ContentHeading').removeClass('ContentHeadingHover');
            });
            $('.SendYourQuery').click(function(){
                ShowModalPopup('divSendQuery', '', '', false);
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" Runat="Server">
    <h4 id="h4Heading" runat="server">Company Profile</h4>
    <div id="divMessage" runat="server" visible="false" enableviewstate="false"></div>

    <asp:Panel ID="pnlFormContainer" runat="server">  
        <%--Company Logo and Name Starts Here--%>      
        <div>
            <div class="floatleft">
                <asp:Image CssClass="ProjectThumbImage" ID="imgCompanyLogo" runat="server" Visible="false" />
            </div>
            <div class="floatleft">
                <div style="margin-left:10px;">
                    <div class="ListTitle">
                        <asp:Literal ID="ltrHeadingCompanyName" runat="server"></asp:Literal>                        
                    </div>                                        
                    <div class="DimmedText"><asp:Literal id="ltrLocation" runat="server"></asp:Literal></div>                    
                </div>
                <div class="clearboth"></div>
            </div>
            <div class="floatright">
                <div class="SendYourQuery"></div>
            </div>
            <div class="clearboth"></div>
        </div>
        <%--Company Logo and Name Ends Here--%>
        
        <%--Company Project Navigation Menu Start  CompanyMenuBack.png --%>
        <% if (_IsDeveloper)
           { %>
        <div style="height:38px; background:url(/Images/CompanyMenuBackHover.png); background-repeat:repeat-x; margin-top:10px;">
            <div class="CompanyTopMenu">
                <ul>
                    <li class="MenuTitle">Projects </li>
                    <%foreach (App.Data.PropertyType propertyType in _PropertyTypes)
                      {
                          if (HasProject(propertyType.ID))
                          {
                          %>
                      <li><a href="/Pages/Public/ProjectList.aspx?<%=AppConstants.QueryString.PROPERTY_TYPE_ID %>=<%= propertyType.ID %>&<%=AppConstants.QueryString.CUSTOMER_ID %>=<%= _CustomerID %>"><%= propertyType.Name%></a></li>  
                    <%    }
                      } %>                                 
                </ul>
            </div>
        </div>
        <%} %>
        <%--Company Project Navigation Menu End --%>
        
        <table cellpadding="0" cellspacing="0" style="width:100%; margin-top:10px;">
            <colgroup>                
                <col style="width:142px;" />
                <col />
            </colgroup>
            <tr>            
                <%--Left Column Start --%>
                <td>                    
                    <asp:Literal id="ltrHotProjects" runat="server"></asp:Literal>
                </td>
                <%--Left Column End--%>
                
                <%--Right Column Start--%>
                <td>
                    <div style="background-color:#fafefa;">
                        <%--<div class="SectionGroupBoxHeading" style="margin-top:0px;">General Information</div>--%> 
                        <div class="ContentBoxContainer">
                            <div class="ContentBox">
                                <div class="ContentHeading">General Information</div>
                                    <table class="GreenLink" cellpadding="0" cellspacing="0" style="width:100%;">
                                        <colgroup>
                                            <col style="width:20%;" />
                                            <col />                                
                                        </colgroup>
                                        <tr>
                                            <td><asp:Label ID="lblName" runat="server" Text="<b>Company Name</b>"></asp:Label></td>
                                            <td><asp:Literal id="ltrCompanyName" runat="server"></asp:Literal></td>                                
                                        </tr>                                                    
                                        <asp:Literal id="ltrAddress" runat="server"></asp:Literal>
                                        <tr>
                                            <td colspan="2"><asp:HyperLink ID="hplWebSite" runat="server" Visible="false" Target="_blank">Click Here to visit this company's web site</asp:HyperLink></td>
                                        </tr> 
                                </table>  
                            </div>         
                        </div>

                        <%--<div class="SectionGroupBoxHeading"><asp:Label ID="Label1" runat="server" Text="About the Company"></asp:Label></div>--%> 
                        <div class="ContentBoxContainer">
                            <div class="ContentBox">
                                <div class="ContentHeading">About the Company</div>
                                <asp:Literal id="ltrAboutUs" runat="server"></asp:Literal>
                            </div>
                        </div>

                        <%--Contacts Listing Starts Here--%>
                        <%--<div class="SectionGroupBoxHeading"><asp:Label ID="Label2" runat="server" Text="Contacts"></asp:Label></div>--%>                                                                                                                                                             <div class="ContentBoxContainer">   
                        <div class="ContentBox">
                            <div class="ContentHeading">Contacts</div>                     
                            <asp:Repeater ID="rptContacts" runat="server">
                                <HeaderTemplate>
                                    <table cellpadding="0" cellspacing="0" style="width:100%;">
                                        <colgroup>
                                            <col />
                                            <col style="width:132px;"/>                                        
                                        </colgroup>                                
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <b>Name:</b> <%# DataBinder.Eval(Container.DataItem, "Name") %><br />
                                            <b>Designation:</b> <%# DataBinder.Eval(Container.DataItem, "Designation")%><br />
                                            <b>Phone:</b> <%# DataBinder.Eval(Container.DataItem, "Phone")%><br />
                                            <b>Fax:</b> <%# DataBinder.Eval(Container.DataItem, "Fax")%><br />
                                            <b>Email:</b> <%# DataBinder.Eval(Container.DataItem, "Email")%><br />
                                        </td>
                                        <td style="padding-bottom:5px;">
                                            <%--<div class="floatright">     --%>                                   
                                                <%#GetPhotoUrl(DataBinder.Eval(Container.DataItem, "Photo"))%>
                                            <%--</div>
                                            <div class="clearboth"></div>--%>
                                        </td>                                    
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </div>
                    </div>                    
                    </div>
                    <div style="margin-top:10px;">
                        <%--<a href="javascript:void(0);" onclick="ShowModalPopup('divSendQuery', '', '', false);">Send Your Query</a>--%>
                        <div class="SendYourQuery"></div>
                    </div>                      
                </td> 
                <%--Right Column End--%>               
            </tr>            
        </table>        
    </asp:Panel>

    <%--Send Query Modal Popup Ends Here--%>
    <div id="divSendQuery" class="PopupContainer" style="display: none; width:500px; height:auto;">        
        <div class="PopupHeaderMiddle">Send Query</div> 
        <div class="PopupBody" style="padding:5px; height:305px;">
            <div id="divSentQueryMessage" class="MessageBox" style="display:none;">Your message has been sent to this company.</div>
            <table id="tblSendQueryForm" cellpadding="3" cellspacing="0" style="width:100%;">
                <colgroup>
                    <col style="width:20%;" />
                    <col />  
                </colgroup>			
				<tr>
					<td>First Name<span class="requiredMark">*</span></td>
					<td>
						<asp:TextBox ID="txtFirstName" MaxLength="50" runat="server"></asp:TextBox>
						<asp:RequiredFieldValidator ID="rfvFirstName" runat="server"
							ControlToValidate="txtFirstName" SetFocusOnError="true"
							ErrorMessage="Please Enter a First Name." Display="Dynamic"
							ValidationGroup="SendQuery">
						</asp:RequiredFieldValidator>
					</td>
				</tr>
				<tr>
					<td>Last Name<span class="requiredMark">*</span></td>
					<td>
						<asp:TextBox ID="txtLastName" MaxLength="50" runat="server"></asp:TextBox>
						<asp:RequiredFieldValidator ID="rfvLastName" runat="server"
							ControlToValidate="txtLastName" SetFocusOnError="true"
							ErrorMessage="Please Enter a Last Name." Display="Dynamic"
							ValidationGroup="SendQuery">
						</asp:RequiredFieldValidator>
					</td>
				</tr>
				<tr>
					<td>Your Email<span class="requiredMark">*</span></td>
					<td>
						<asp:TextBox ID="txtFromEmail" MaxLength="50" runat="server"></asp:TextBox>
						<asp:RequiredFieldValidator ID="rfvFromEmail" runat="server"
							ControlToValidate="txtFromEmail" SetFocusOnError="true"
							ErrorMessage="Please Enter Your Email." Display="Dynamic"
							ValidationGroup="SendQuery">
						</asp:RequiredFieldValidator>
					</td>
				</tr>
				<tr>
					<td>Address</td>
					<td>
						<asp:TextBox ID="txtAddress" TextMode="MultiLine" MaxLength="400" runat="server" style="height:50px;"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td>Phone</td>
					<td>
						<asp:TextBox ID="txtPhone" MaxLength="30" runat="server"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td>Subject<span class="requiredMark">*</span></td>
					<td>
						<asp:TextBox ID="txtSubject" MaxLength="150" runat="server"></asp:TextBox>
						<asp:RequiredFieldValidator ID="rfvSubject" runat="server"
							ControlToValidate="txtSubject" SetFocusOnError="true"
							ErrorMessage="Please Enter a Subject." Display="Dynamic"
							ValidationGroup="SendQuery">
						</asp:RequiredFieldValidator>
					</td>
				</tr>
				<tr>
					<td>Message<span class="requiredMark">*</span></td>
					<td>
						<asp:TextBox ID="txtMessage" TextMode="MultiLine" MaxLength="2000" runat="server" style="height:50px;"></asp:TextBox>
						<asp:RequiredFieldValidator ID="rfvMessage" runat="server"
							ControlToValidate="txtMessage" SetFocusOnError="true"
							ErrorMessage="Please Enter a Message." Display="Dynamic"
							ValidationGroup="SendQuery">
						</asp:RequiredFieldValidator>
					</td>
				</tr>				                    
            </table>           
        </div>
        <div class="PopupButtonContainer">  
            <input id="btnSendQuery" type="button" value="Send" class="ButtonCommon" onclick="SendQuery('btnSendQuery');" />           
            <input type="button" value="Close" class="ButtonInActive" onclick="HideModalPopup();" />            
        </div>
    </div>
    <%--Send Query End--%>
</asp:Content>

